package com.cskaoyan.crud;

import com.cskaoyan.bean.User;
import com.cskaoyan.mapper.UserMapper;
import com.cskaoyan.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

/**
 * 创建日期: 2022/10/14 17:13
 *
 * @author ciggar
 */
public class DeleteDemo {

    public static void main(String[] args) {

        // 获取SqlSession
        SqlSession sqlSession = MybatisUtils.getSqlSession();

        // 获取接口的代理对象
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);

        // 执行方法
        int affectedRows = mapper.deleteUserById(1005);

        System.out.println("affectedRows:" + affectedRows);


    }
}
